/**
 *@Title: Resource.java
 *@Description: TODO
 *@author:Lau
 *@date 2017年7月17日 下午11:48:36 
 *@version V1.0
 */
package com.lty.prototest.serial;

/** 
* @ClassName: Resource 
* @Description: TODO
* @author Lau 
* @date 2017年7月17日 下午11:48:36 
*  
*/
public class Resource extends Serializer{
	private Long gold;
	private Integer energy;
	
	/** 
	* @Title: 
	* @Description: TODO
	* @param 
	* @return
	* @throws 
	*/
	public Resource() {

	}
	
	/** 
	* @Title: 
	* @Description: TODO
	* @param @param gold
	* @param @param energy
	* @return
	* @throws 
	*/
	public Resource(Long gold, int energy) {
		this.gold = gold;
		this.energy = energy;
	}


	/**
	 * @return the gold
	 */
	public Long getGold() {
		return gold;
	}
	/**
	 * @param gold the gold to set
	 */
	public void setGold(Long gold) {
		this.gold = gold;
	}
	/**
	 * @return the energy
	 */
	public Integer getEnergy() {
		return energy;
	}
	/**
	 * @param energy the energy to set
	 */
	public void setEnergy(Integer energy) {
		this.energy = energy;
	}

	/* 
	* <p>Title: read</p> 
	* <p>Description: </p>  
	* @see com.lty.prototest.serial.Serializer#read() 
	*/
	@Override
	protected void read() {
		this.gold = readLong();
		this.energy = readInt();
	}

	/* 
	* <p>Title: write</p> 
	* <p>Description: </p>  
	* @see com.lty.prototest.serial.Serializer#write() 
	*/
	@Override
	protected void write() {
		writeLong(this.gold);
		writeInt(this.energy);
	}

	/* 
	* <p>Title: toString</p> 
	* <p>Description: </p> 
	* @return 
	* @see java.lang.Object#toString() 
	*/
	@Override
	public String toString() {
		return "Resource [gold=" + gold + ", energy=" + energy + "]";
	}
}
